/*
 * Clock.h
 *
 *  Created on: Mar 3, 2010
 *      Author: dcrown
 */

#ifndef CLOCK_H_
#define CLOCK_H_

#include <windows.h>
#include <map>
#include <string>

using namespace std;

class Clock
{
public:

	enum MarkAction
	{
		LEAVE_MARK,
		REMOVE_MARK,
		UPDATE_MARK,
		NA
	};

	void Start();
	DWORD GetTime() {return timeGetTime() - startTime;}
	float GetTimeInSec();

	DWORD Mark(string id, MarkAction ma);
	DWORD GetTimeSinceMark(string id, MarkAction ma);
	float GetTimeSinceMarkInSec(string id, MarkAction ma);

private:
	DWORD startTime;
	map<string, DWORD> markMap;
};
#endif /* CLOCK_H_ */
